package com.speoki.springboot.service;

import com.speoki.springboot.mapper.Course;
import com.speoki.springboot.mapper.CourseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service
public class CourseServiceImpl implements CourseService {
   @Autowired
    CourseMapper courseMapper;
    @Override
    public Integer insertCourse(Course course) {
        return courseMapper.insertSelective(course);
    }

    @Override
    public List<Course> getAll() {
        return courseMapper.getAll();
    }

    @Override
    public Course queryCourseById(Integer id) {
        Course course = courseMapper.selectByPrimaryKey(id);
        return course;
    }
/*

    @Override
    public List<CourseAvg> getavgCourse() {
        return courseMapper.getAvgCourse();
    }
*/
@Override
public List<Map<String,String>> GetStudentCourse(){
    return courseMapper.getStudentCourse();
}

    @Override
    public List<Map<String,Object>> getavgCourse2() {
        return courseMapper.getCourseAvg2();
    }
}
